package pojo.jane;

import java.util.Date;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import util.annotation.JspTableColumnIgnore;
import util.annotation.JspTableColumnName;
import util.annotation.JspTableEntity;

@SuppressWarnings("serial")
@Entity
@Table(name="wechat_user")
@JspTableEntity
public class StudentBean implements java.io.Serializable{
	/**
	 * 
	 */
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@JspTableColumnIgnore
	private int id;
	@JspTableColumnName(colName="ID")
	private String userid;
	@JspTableColumnName(colName="姓名")
	private String name;
	@JspTableColumnName(colName="邮箱")
	private String email;
	@JspTableColumnName(colName="手机号")
	private String phone;
	@JspTableColumnIgnore
	private String password;
	@JspTableColumnName(colName="学生类型")
	private Integer identity; 
	@JspTableColumnName(colName="注册时间")
	private Date time;
	@JspTableColumnName(colName="权限")
	private Integer authgroup;
	@JspTableColumnName(colName="起")
	private Integer lower;
	@JspTableColumnName(colName="止")
	private Integer upper;
	@JspTableColumnIgnore
	@OneToMany(targetEntity=AuthorityBean.class)
	@JoinColumn(name="authgroup",insertable=false,updatable=false,referencedColumnName="authgroup")
	List<AuthorityBean> authority;
	
	public StudentBean(){
		
	}
	
	public StudentBean(String userid, String name, String email, String phone,
			Integer identity, Date time, Integer authgroup, Integer lower, Integer upper) {
		super();
		this.userid = userid;
		this.name = name;
		this.email = email;
		this.phone = phone;
		this.identity = identity;
		this.time = time;
		this.authgroup = authgroup;
		this.lower = lower;
		this.upper = upper;
	}
	
	public StudentBean(String userid, String name, String email, String phone,
			String password, Integer identity, Date time, Integer authgroup) {
		super();
		this.userid = userid;
		this.name = name;
		this.email = email;
		this.phone = phone;
		this.password = password;
		this.identity = identity;
		this.time = time;
		this.authgroup = authgroup;
	}
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getUserid() {
		return userid;
	}
	public void setUserid(String userid) {
		this.userid = userid;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public Integer getIdentity() {
		return identity;
	}
	public void setIdentity(Integer identity) {
		this.identity = identity;
	}
	public Date getTime() {
		return time;
	}
	public void setTime(Date time) {
		this.time = time;
	}
	public Integer getAuthgroup() {
		return authgroup;
	}
	public void setAuthgroup(Integer authgroup) {
		this.authgroup = authgroup;
	}

	public Integer getlower() {
		return lower;
	}

	public void setlower(Integer lower) {
		this.lower = lower;
	}

	public Integer getupper() {
		return upper;
	}

	public void setupper(Integer upper) {
		this.upper = upper;
	} 
	
}
